<template>
  <div>
    <n-modal
      style="width:500px"
      v-model:show="Obj.ModelBox"
      positive-text="确认"
      @positive-click="onPositiveClick"
      @negative-click="onNegativeClick"
      @Close="Close"
      negative-text="取消"
      :show-icon="false"
      preset="dialog"
    >
      <template #header>
        <div>{{ Obj.title }}</div>
      </template>
      <div>
        {{Obj.center}}
      </div>
      <!-- <template #action>
        <div>操作</div>
      </template> -->
    </n-modal>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue';
// import { useMessage } from 'naive-ui'
export default defineComponent({
  name: 'Model',
  props: {
    title: {
      type: String,
    },
    ModelBox: {
      type: Boolean,
    },
    center: {
      type: String,
    }
  },
  setup(props, { emit }) {
    const formRef = ref(null)
    const Obj = props;
    //模态框关闭事件
    const onPositiveClick = () => {
      emit('determine', false);
    };
    const Close = () => {
      emit('close',false)
    }
    const onNegativeClick = () => {
      emit('close',false)
    }
    return {
      Obj,
      onPositiveClick,
      onNegativeClick,
      Close,
      formRef,
    };
  },
});
</script>

<style lang="less" scoped>

</style>
